<%@ page language="java" pageEncoding="UTF-8"
         contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
    String path = request.getContextPath();
// 获得项目完全路径（假设你的项目叫MyApp，那么获得到的地址就是http://localhost:8080/MyApp/）:
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>网站后台管理系统HTML模板--模板之家 www.cssmoban.com</title>
    <link href="<%=basePath%>jsp/backstage/css/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="<%=basePath%>jsp/backstage/js/jquery.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $(".click").click(function () {
                $(".tip").fadeIn(200);
            });

            $(".tiptop a").click(function () {
                $(".tip").fadeOut(200);
            });

            $(".sure").click(function () {
                $(".tip").fadeOut(100);
            });

            $(".cancel").click(function () {
                $(".tip").fadeOut(100);
            });

            $("a[name='deleteAdmin']").click(function(){
                if(confirm("您确定要删除该条账户信息么？删除后无法再恢复!")){
                    return true;
                }else{
                    return  false;//让链接点击事件无效
                }
            });


        });
    </script>


</head>


<body>

<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">首页</a></li>
        <li><a href="#">管理员管理</a></li>
    </ul>
</div>

<div class="rightinfo">

    <div class="tools">

        <ul class="toolbar">
            <li class="click">
                <a href="<%=basePath%>backstage/adminmanage/toAddAdmin">
                    <span>
                        <img src="<%=basePath%>jsp/backstage/images/t01.png"/>
                    </span>添加管理账户
                </a>
            </li>
        </ul>


        <ul class="toolbar1">
            <li><span><img src="images/t05.png"/></span>设置</li>
        </ul>

    </div>


    <table class="tablelist">
        <thead>
        <tr>
            <th><input name="" type="checkbox" value="" checked="checked"/></th>
<%--            <th>${admin.username}</th>--%>
            <th>账户名</th>
            <th>姓名</th>
            <th>性别</th>
            <th>是否锁定</th>
            <th>发布时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="admin" items="${requestScope.list}">
        <tr>
            <td><input name="" type="checkbox" value=""/></td>
            <td>${admin.username}</td>
            <td>${admin.name}</td>
            <td>
                <c:choose>
                    <c:when test="${admin.sex==1}">男</c:when>
                    <c:otherwise>女</c:otherwise>
                </c:choose>
            </td>
            <td>
                <c:choose>
                    <c:when test="${admin.unLocked==true}">不锁定</c:when>
                    <c:otherwise>
                        <span style="color: red">锁定</span>
                    </c:otherwise>
                </c:choose>
            </td>
            <td>
                <fmt:formatDate value="${admin.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
            <td>
                <a href="<%=basePath%>backstage/adminmanage/toUpdateAdmin?id=${admin.id}" class="tablelink">编辑</a>
                <a name="deleteAdmin" href="<%=basePath%>backstage/adminmanage/delete?id=${admin.id}" class="tablelink">删除</a>
            </td>
        </tr>
        </c:forEach>

        </tbody>
    </table>


    <div class="pagin">
        <div class="message">共<i class="blue">${fn:length(requestScope.list)}</i>条记录</div>
    </div>


</div>

<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');
</script>
</body>
</html>
